<?php
require_once(dirname(__FILE__)."/config.php");
/**
* 修改dedcms图片上传到“又拍”云存储
* @林少能
* linshaoneng@sina.cn
* QQ:10832126
* http://qingphp.sinaapp.com
*/
?>
<html>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'>
<title>upload img</title>
<link href='../../plus/img/base.css' rel='stylesheet' type='text/css'>
<style>
.linerow {border-bottom: 1px solid #CBD8AC;}
.napisdiv {left:40;top:3;width:150px;height:100px;position:absolute;z-index:3;display:none;}
</style>
<script>
function nullLink(){ return; }
function ChangeImage(surl){ document.getElementById('picview').src = surl; }
</script>
</head>
<body background='img/allbg.gif' leftmargin='0' topmargin='0'>
<div id="floater" class="napisdiv">
<a href="javascript:nullLink();" onClick="document.getElementById('floater').style.display='none';"><img src='img/picviewnone.gif' id='picview' border='0' alt='单击关闭预览'></a>
</div>
<SCRIPT language=JavaScript src="js/float.js"></SCRIPT>
<SCRIPT language=JavaScript>
function nullLink(){ return; }
function ChangeImage(surl){ document.getElementById('floater').style.display='block';document.getElementById('picview').src = surl; }
function TNav()
{
	if(window.navigator.userAgent.indexOf("MSIE")>=1) return 'IE';
  else if(window.navigator.userAgent.indexOf("Firefox")>=1) return 'FF';
  else return "OT";
}
function ReturnImg(reimg)
{
	window.opener.document.<?php echo $f?>.value=reimg;
	if(window.opener.document.getElementById('div<?php echo $v?>'))
  {
  	 if(TNav()=='IE'){
  	 	 window.opener.document.getElementById('div<?php echo $v?>').filters.item('DXImageTransform.Microsoft.AlphaImageLoader').src = reimg;
  	 	 window.opener.document.getElementById('div<?php echo $v?>').style.width = '150px';
  	 	 window.opener.document.getElementById('div<?php echo $v?>').style.height = '100px';
  	 }
  	 else
  	 	 window.opener.document.getElementById('div<?php echo $v?>').style.backgroundImage = "url("+reimg+")";
  }
	else if(window.opener.document.getElementById('<?php echo $v?>')){
		window.opener.document.getElementById('<?php echo $v?>').src = reimg;
	}
	if(document.all) window.opener=true;
  window.close();
}
</SCRIPT>
<table width='100%' border='0' cellspacing='0' cellpadding='0' align="center">
<tr>
<td colspan='4' align='right'>
<table width='100%' border='0' cellpadding='0' cellspacing='1' bgcolor='#CBD8AC'>

<td colspan='4' bgcolor='#E8F1DE'>

<table width='100%'>
<form action='select_images_post.php' method='POST' enctype="multipart/form-data" name='myform'>
<tr>
<td background="img/tbg.gif" bgcolor="#99CC00">
  &nbsp;上　传： <input type='file' name='imgfile' style='width:250px'>
    <input type='hidden' name='activepath' value='<?php echo $activepath?>'>
    <input type='hidden' name='f' value='<?php echo $f?>'>
    <input type='hidden' name='v' value='<?php echo $v?>'>
    <input type='hidden' name='imgstick' value='<?php echo $imgstick?>'>
    <input type='hidden' name='CKEditorFuncNum' value='<?php echo isset($CKEditorFuncNum)? $CKEditorFuncNum : 1;?>'>
    <input type='hidden' name='job' value='upload'>
  <input type='submit' name='sb1' value='确定'>
    <br />
    <?php
    if( $_GET['img']<>'' ){
    ?>
  <a onclick="javascript:ReturnImg('http://<?php echo $_GET['img']; ?>');" href="#"><img src="http://<?php echo $_GET['img']; ?>" width="600" border="0" /></a>
    <?php
    }
    ?>
</td>
</tr>
</form>
</table>

</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>